<!DOCTYPE html >
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>window.open</title>
</head>
<body>
<input type="button" onClick="openweb()" value="开始发送信息">
</body>
</html>
<script>

var win=null;
function openweb()
{
setTimeout(
		function()
		{
			console.log("即将发送消息：'hello world'")
			win=window.open('child.html','child')
		}
	,500)
setTimeout(
		function()
		{
			win.postMessage('hello world',"*")
		}
	,3000)
}
</script>